package com.threadExample;

/**
 * Created by yijy on 2017/7/26.
 */
public class ThreadTest_sleep extends Thread {
    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName()+":main start");
        Thread test5 = new ThreadTest_sleep();
        Thread t6 = new ThreadTest_sleep();
        test5.start();
        t6.start();
        Thread.yield();
        System.out.println(Thread.currentThread().getName()+":main end");
    }

    @Override
    public void run() {
        for(int i=0;i<300;i++){
            System.out.println(getName()+":"+i);
//            try {
//                Thread.sleep(100);
//            } catch (InterruptedException e) {
//                e.printStackTrace();
//            }
        }
    }
}
